package week_home_work02;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/22
 */
public class Demo10 {
    public static void main(String[] args) {
        //输入一个数字，判断它是否为3的倍数或者5的倍数。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int num = sc.nextInt();
        if (num % 3 == 0 && num % 5 == 0) {
            System.out.println(num + "既是3的倍数也是5的倍数");
            return;
        }
        if (num % 3 == 0) {
            System.out.println(num + "是3的倍数");
        } else if (num % 5 == 0) {
            System.out.println(num + "是5的倍数");
        } else {
            System.out.println(num + "既不是3的倍数也不是5的倍数");
        }
    }
}
